package model;

import java.math.BigDecimal;

public class Debtor extends PersonBasis implements IPayable {
	BigDecimal amount;

	public BigDecimal getAmount() {
		return amount;
	}

	public Debtor(String name, BigDecimal amount) {
		super(name);
		this.amount = amount;
	}

	public void addAmount(BigDecimal amount) {
		this.amount = this.amount.add(amount);
	}
	
	@Override
	public boolean equals(Object o) {
		if (o instanceof Debtor) {
			Debtor temp = (Debtor) o;
			if (this.name.equals(temp.getName())) {
				return true;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode(){
		assert false : "hashCode not implemented";
		return 2;
	}

}
